package com.naiterui.ehp.bs.consult.repository;

import java.util.Collection;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bp.domain.VideoConsultMessage;

/**
 * 视频咨询记录
 *
 * @author yangfuya
 * @version 1.0
 * @date 2021-02-27 15:39
 **/
@Repository
public interface VideoConsultMessageRepository extends BaseJpaRepository<VideoConsultMessage, Long> {
    /**
     * 根据视频咨询id获取聊天记录
     *
     * @param videoConsultId
     * @return
     */
    List<VideoConsultMessage> findByVideoConsultId(Long videoConsultId);

    List<VideoConsultMessage> findByVideoConsultIdIn(Collection videoConsultIds);

    /**
     * 根据处方id获取聊天记录
     * @param content
     * @return
     */
    VideoConsultMessage findByContent(String content);

    /**
     * 根据视频问诊id和类型查找问诊聊天
     * @param videoConsultId
     * @param type
     * @return
     */
    VideoConsultMessage findFirstByVideoConsultIdAndType(Long videoConsultId, Integer type);

    List<VideoConsultMessage> findByVideoConsultIdAndType(Long videoConsultId, Integer type);

    List<VideoConsultMessage> findByVideoConsultIdAndTypeIn(Long videoConsultId, List<Integer> types);

    List<VideoConsultMessage> findByContentInAndType(List<String> contents, Integer type);

}
